﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ModelLayer;

namespace WcfLayer
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IWcfFoodAndAllergies
    {

        #region User
        [OperationContract]
        int InsertUser(User _user);
        [OperationContract]
        User GetUser(string _userPassword);

        [OperationContract]
        User GetUserByUserNameAndPassword(string _userName, string _userPassword);

        [OperationContract]
        int UpdateUser(User _user);


        #endregion
        #region Recipe

        [OperationContract]
        int InsertRecipe(Recipe _recipe);

        [OperationContract]
        List<Recipe> GetRecipeByAllergi(List<Allergies> _allergies);

        [OperationContract]
        Recipe GetRecipeById(int id);
        [OperationContract]
        List<Recipe> GetRecipeByType(string _type);

        [OperationContract]
        List<Recipe> GetRecipeByName(string _name);

        [OperationContract]
        List<Recipe> GetRecipeByAllergies(List<Allergies> _list);
        [OperationContract]
        List<Recipe> GetAllergiFriendlyRecipies(List<Allergies> _allergies);
        [OperationContract]
        List<Recipe> SelectAllRecipe();


        #endregion
        #region Allergies

        [OperationContract]
        int InsertAllergies(Allergies _allergies);
        [OperationContract]
        Allergies GetAllergiesById(int _id);
        [OperationContract]
        Allergies GetAllergies(string _name);
        [OperationContract]
        List<Allergies> SelectAllAllergies();

        [OperationContract]
        List<Allergies> GetAllegiesFromProduct(int _productId);
        [OperationContract]
        List<Allergies> GetUserAllergies(User _user);
        #endregion
        #region Product

        [OperationContract]
        int InsertProduct(Product _product);

        [OperationContract]
        List<Product> GetProductByName(string _name);
        [OperationContract]
        Product GetExactProductByName(string _name);
        [OperationContract]
        List<Product> GetProductByType(string _type);

        [OperationContract]
        List<Product> SelectAllProduct();
        [OperationContract]
        List<String> GetProductTypes();
        [OperationContract]
        List<Product> GetProductByAllergies(List<Allergies> _list);
        [OperationContract]
        List<Product> GetProductByRecipe(Recipe _recipe);
        [OperationContract]
        List<Product> GetRemaningProducts(List<Product> _products);
        [OperationContract]
        List<Product> GetProductByNameAndType(string _name, string _type);
        #endregion
    }


}
